using Cache.Redis;
using Common;
using Model.Table;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

namespace Service.Table
{
    public class TablePlayerLevel : TableBase
	{
        private const string Tablename = "Table_PlayerLevel";

		public int mLevel;
		public int mExp;
		public List<int> mLockBuilding;

		public override string GetTableName()
		{
			return Tablename;
		}

		public override void ParseToObject(Dictionary<string,object> _dic)
		{
			mLevel = int.Parse(_dic["id"].ToString());
			mExp = int.Parse(_dic["money"].ToString());

			string[] str_unlock = _dic["unlock_id"].ToString().Split('|');
			mLockBuilding = new List<int>();
			for(int i = 0 ; i<str_unlock.Length ; i++)
			{
				if(!string.IsNullOrEmpty(str_unlock[i]) && str_unlock[i] != TableBase.NULL)
				{
					int lock_id = int.Parse(str_unlock[i]);
					mLockBuilding.Add(lock_id);
				}
			}
		}
	}

}